<?php

require_once 'Zend/Loader/PluginLoader.php';
require_once 'Zend/Controller/Action/Helper/Abstract.php';
require_once 'models/User.php';
require_once 'Base.php';
require_once 'Zend/Mail.php';

/**
 * EmailServ Action Helper
 *
 * @uses actionHelper Custom_Helper
 */
class Custom_Helper_SendActivationEmail extends Dummy_Helper_Base
{
	public function sendEmail($username,$addr,$activation)	{
		$this->view->username=$username;
		$this->view->activation=$activation;
		$content = $this->view->render('includes/ActivationEmail.phtml');
		
		$mail = new Zend_Mail('utf-8');
		$mail->setBodyHTML($content);
		$mail->setFrom('no-reply@bkprofile.com', 'BKProfile Team');
		$mail->addTo($addr, $username);
		$mail->setSubject(Message::EMAIL_VALIDATION);
		$mail->send();
		return true;
	}
	
	public function direct($username,$addr,$activation)	{
		return $this->sendEmail($username, $addr, $activation);
	}
}